import {Component} from 'react';
import {Row, Col, Button, Empty, Spin} from 'antd';
import DataDetail from '~/component/DataDetail';


class CollectListView extends Component {

    // 明细导出
    onDownloadReport = () => {
        const {collectId, onDownloadReport} = this.props;
        onDownloadReport(collectId);
    };

    render() {
        const {downLoading, isloading, dataSource, columns} = this.props;
        return (
            <div>
                <div className="deContent">
                    <h3 style={{display: 'inline-block'}}>
                        课节数据汇总
                        <span className="subTitle">(查询课节结课后展示数据)</span>
                    </h3>
                    <Button onClick={this.onDownloadReport} loading={downLoading} disabled={!dataSource.length}>
                        明细导出
                    </Button>
                </div>
                <DataDetail
                    isLoading={isloading}
                    dataSource={dataSource}
                    columns={columns}
                    scroll={{x: columns.length * 200}}
                />
            </div>
        );
    }
}

export default CollectListView;
